<?php get_instance()->view('common/header');?>
<style type="text/css">
    <!--
    .text-val {
        padding-top: 3px;
        padding-left: 0;
    }

    .text-label {
        color: grey;
        text-align: right;
    }

    .btn-group, .btn-group-vertical {
        display: inline-block;
        position: absolute;
        vertical-align: middle;
    }

    .sale-summary li:first-child {
        border-top: medium none;
    }

    .sale-summary li {
        border-top: 1px solid #eee;
        overflow: hidden;
        padding: 10px 0;
    }

    .sale-summary li .sale-info {
        color: #646464;
        float: left;
        font-size: 14px;
        text-transform: uppercase;
    }

    .sale-summary li .sale-num {
        color: #169ef4;
        float: right;
        font-size: 20px;
        font-weight: 300;
    }

    .description-box img {
        width: 100%;
    }
    -->
</style>
<style type="text/css">
    div .radio-inline:nth-child(2), div .checkbox-inline:nth-child(2) {
        margin-left: 10px;
    }
    div.form-body>.tab-pane{display: none}
    div.form-body>.tab-pane.active{display: block}

    .table-scrollable > .table > thead > tr > th, .table-scrollable > .table > tbody > tr > th, .table-scrollable > .table > tfoot > tr > th, .table-scrollable > .table > thead > tr > td, .table-scrollable > .table > tbody > tr > td, .table-scrollable > .table > tfoot > tr > td{
        word-break:break-all;
    }
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"><?php echo $title?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('config/promotion/');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li> <i class="fa fa-home"></i> <a href="<?php echo getUrl('config/promotion/');?>"> 红包管理  <i class="fa fa-angle-right"></i> </a></li>
                        <li><a href="javascript:void(0);"><?php echo $title?></a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-12 profile-info">
                            <div class="row">
                                <div class="col-md-12">
                                    <div style="border: 1px solid #ddd; padding: 10px; margin-bottom: 30px;">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">名称：</label>
                                                    <div class="col-md-8 text-val nickname"><?php echo $info['name'];?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">面额：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['money'];?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">消费金额：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['condition'];?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">发放类型：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['type_name'];?></div>
                                                </div>
                                            </div>
                                            <?php if ($info['type'] == 3):?>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-md-4 control-label text-label">发放总数量：</label>
                                                        <div class="col-md-8 text-val"><?php echo $info['send_number'];?></div>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-md-4 control-label text-label">剩余数量：</label>
                                                        <div class="col-md-8 text-val"><?php echo $info['surplus_number'];?></div>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-md-4 control-label text-label">发放开始日期：</label>
                                                        <div class="col-md-8 text-val"><?php echo $info['send_start_time'];?></div>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <div class="form-group">
                                                        <label class="col-md-4 control-label text-label">发放结束日期：</label>
                                                        <div class="col-md-8 text-val"><?php echo $info['send_end_time'];?></div>
                                                    </div>
                                                </div>
                                            <?php endif;?>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">使用起始日期：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['use_start_time'];?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">使用截止日期：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['use_end_time'];?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">状态：</label>
                                                    <div class="col-md-8 text-val"><?php echo $info['status'] == 2 ? '已发布' : '未发布';?></div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label text-label">发放时间：</label>
                                                    <div class="col-md-8 text-val"><?php echo dateFormat($info['addtime']);?></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end col-md-8-->
                    </div>
                    <!--end row-->
                    <div class="tabbable tabbable-custom tabbable-custom-profile">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1_1" data-toggle="tab"> 用户领取详情 </a></li>
                        </ul>
                        <div class="tab-content">
                            <!--用户订单-->
                            <div class="active tab-pane" id="tab_1_1">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <table class="table table-bordered table-hover" id="data_table_bonus_log">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th>消费者</th>
                                                <th>领取金额</th>
                                                <th>订单编码</th>
                                                <th>优惠码</th>
                                                <th>是否使用</th>
                                                <th>使用时间</th>
                                                <th>添加时间</th>
                                                <th width="100px"> 操作</th>
                                            </tr>
                                            <tr>
                                                <th><input class="form-control form-filter input-sm" name="consumer" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="money" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="order_code" type="text"></th>
                                                <th><input class="form-control form-filter input-sm" name="code" type="text" ></th></th>
                                                <th>
                                                    <select name="status" class="form-control form-filter input-sm">
                                                        <option value="" selected="selected">所有</option>
                                                        <?php foreach ($status as $k => $v):?>
                                                            <option value="<?php echo $k;?>"><?php echo $v;?></option>
                                                        <?php endforeach;?>
                                                    </select>
                                                </th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="used_time_date_from" dp placeholder="从" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="used_time_date_to" dp placeholder="到" type="text" >
                                                </th>
                                                <th>
                                                    <div class="margin-bottom-5">
                                                        <input class="form-control form-filter input-sm" name="send_date_from" dp placeholder="从" type="text">
                                                    </div>
                                                    <input class="form-control form-filter input-sm" name="send_date_to" dp placeholder="到" type="text" >
                                                </th>
                                                <th>
                                                    <div class="btn-group">
                                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                        </ul>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var id = <?php echo $info['id'];?>;
    $(function(){
        datatable_init({
            src: $("#data_table_bonus_log"),
            sAjaxSource: "<?php echo getUrl('config/promotion/getBonusLog?bonus_id=');?>"+id,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,2,3,4,7]
            }]
        });

        $('[dp]').not("[noinit]").datepicker({
            changeMonth: true,
            autoclose: true,
            format: "yyyy-mm-dd",
            language: 'zh-CN'
        });
    });

    function ajaxRequestCallBack() {
    }

</script>
</body>
</html>